let DefaultConfig = {
    // GLOBAL
    language: "zh_CN",
    theme: 'modern',
    branding: false,
    elementpath: false,
    element_format : 'html',
    auto_focus: 'tinymceEditer',
    plugins: `autolink
             advlist
             autosave
             link
             image
             imagetools
             media
             hr
             fullscreen
             lists
             paste
             preview
             searchreplace
             table
             template
             textcolor
             colorpicker
             importcss
             contextmenu
             pagebreak
             `,
    toolbar1: `fullscreen bold forecolor backcolor paragraph 
    template styleselect fontsizeselect`,
    toolbar2: `indent outdent alignleft aligncenter alignright image br restoredraft clear edit certain`,
    contextmenu_never_use_native: true,
    default_link_target: "_blank",
    autosave_restore_when_empty: true,
    // content_css: ['https://dw-pro.iduov.com/dw-share/css/app.css', 'https://dw-pro.iduov.com/dw-share/css/weekb-detail.css', 'https://dw-pro.iduov.com/dw-share/css/todayExper-detail.css', 'https://dw-pro.iduov.com/dw-share/css/article.css', 'https://dw-pro.iduov.com/dw-share/css/head-line.css'],
    content_css_cors: false,
    contextmenu: "link image imagetools table spellchecker",
    image_list: [
        {title: '读世界底部图', value: 'https://v.iduov.com/readworld/fxpyq.png'}
    ],
    image_description: false,
    image_dimensions: false,
    image_advtab: true,
    images_upload_url: "/upload",
    imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
    imagetools_cors_hosts: ['v.iduov.com'],
    imagetools_credentials_hosts: ['v.iduov.com'],
    textcolor_map: [
      "000000", "黑色",
      "333333", "深灰色",
      "999999", "浅灰色",
      "FFFFFF", "白色",
      "666666", "灰色",
      "00a1ea", "鼎翊蓝"
    ],
    plugin_preview_width: 375,
    style_formats: [
      {title: '格式化', format: 'p'},
      {title: '图片说明', block: 'p', styles: {
        'margin': '0 0 15px',
        'font-size': '14px',
        "line-height": '30px',
        "color": '#999',
        'text-align': 'center'
      }},
      {title: '文字标题', block: 'p', styles: {
        "font-size": "16px",
        "color": "#333",
        "line-height": "24px",
        "padding": "10px",
        "font-weight": "bold",
        "background": "rgba(239,184,117,.5)",
        "text-align": "center"
      }},
      {title: '数字标题', block: 'p', styles: {
        "width":"60px",
        "height":"60px",
        "font-size": "18px",
        "color": "#333",
        "line-height": "60px",
        "font-weight": "bold",
        "background": "rgba(239,184,117,.5)",
        "text-align": "center"
      }}
    ],
    withCredentials: true,
    // object_resizing: false,//是否允许编辑图片
    table_default_attributes: {
        border: '1'
    },
    table_default_styles: {
        width: "100%",
        borderCollapse: "collapse",
    },
    table_responsive_width: true,
    template_selected_content_classes: "selcontent",
    template_popup_width: 375,
    templates: [
        {
          title: '热读好文-导读', 
          description: '热读好文导读模板', 
          content: `<div style="margin-top:30px;padding: 10px;border:1px solid #f1f1f1;position: relative;"><span style="font-weight: bold;
          background: #01a3e2;
          color: #fff;
          padding: 0px 15px;
          border-radius: 4px;
          position: absolute;
          top: -20px;
          left: 25px;">导读</span><div style="padding: 15px;background: #f1f1f1;
          font-size: 14px;"><p class="selcontent" style="line-height:38px;margin:0;word-break:normal;">内容</p></div></div>`
        },
        {
          title: '多维观点',
          description: '多维观点模板',
          content: `<div style="word-break:normal;padding:20px 10px;background:#e5f8ff;color:#00a1ea;margin-top: 32px;
          line-height: 38px;">
          <div style="border:1px dashed #00a1ea;padding:20px;">
          <span class="font-18 center font-bold" style="background:#00a1ea;color:#fff;width:140px;height:40px;display:block;margin:0 auto;line-height:40px;font-weight:bold;font-size:18px;text-align:center;">多维观点</span>
          <p class="selcontent" style="line-height:38px;word-break:normal;color:#00a1ea;font-size:15px;margin-bottom:0;">内容</p></div></div>`
        },
        {
          title: '好书',
          description: '好书',
          content: `<div style="padding:15px 15px 30px;background:#FFF5E5;"><div style="padding:0;color:#C6901F;margin:15px 0 0;font-size:16px;line-height:36px" class="selcontent paragraph"></div></div>`
        },
        {
          title: '文字标题',
          description: '宽度100%自适应',
          content: `<p style="font-size:16px;color:#333333;line-height:24px;padding:10px;background:rgba(239,184,117,.5);font-weight:bold;text-align:center" class="selcontent">标题1</p>`
        },
        {
          title: '数字标题',
          description: '宽高固定',
          content: `<p style="width:60px;height:60px;font-size:16px;color:#333333;line-height:60px;background:rgba(239,184,117,.5);font-weight:bold;text-align:center;margin:15px auto" class="selcontent">01</p>`
        },
        {
          title: '精选语录',
          description: '读笔记',
          content: `<div style="background:#f8f8f8;padding:15px;" class="selcontent">精选语录</div>`
        },
        {
          title: '读笔记正文',
          description: '读笔记',
          content: `<div style="background:#f2f9fe;padding:25px 5%;" class="selcontent">读笔记正文</div>`
        },
        {
          title: '读笔记-标题',
          description: '',
          content: `<div style="width:98%;margin-bottom:25px;padding-bottom:20px;border-bottom:1px solid #70c2f8"><div class="selcontent" style="padding:5px 10px;background:#70c2f8;color:#fff;display:inline-block;font-weight:bold;font-size:16px">内容</div></div>`
        }
    ],
    menubar: "file edit insert view format table tools",
    fontsize_formats: '11px 12px 14px 16px 18px 24px 36px 48px',
    importcss_append: true,

    // CONFIG: ContentStyle 这块很重要， 在最后呈现的页面也要写入这个基本样式保证前后一致， `table`和`img`的问题基本就靠这个来填坑了
    content_style: `
      *                         { padding:0; margin:0; }
      html                      { overflow:hidden }
      html, body                { height:100%;}
      body                      { padding:0 10px;overflow:auto }
      img                       { width:100%; display:block;height:auto;margin:0 auto }
      a                         { text-decoration: none; }
      iframe                    { width: 375px; }
      p                         { line-height:1.6;font-size:14px;margin:10px auto; }
      table                     { word-wrap:break-word; word-break:break-all; max-width:100%; border:none; border-color:#999; }
      .mce-object-iframe        { width:100%; box-sizing:border-box; margin:0; padding:0; }
      ul,ol                     { list-style-position:inside; }
    `,
    // CONFIG: Paste
    paste_data_images: true,
    paste_retain_style_properties: "color font-style font-weight",
    paste_webkit_styles: 'color font-style font-weight',
    paste_filter_drop: false,
    paste_word_valid_elements: "b,strong,i,em,span,p,img",
    paste_convert_word_fake_lists: false,
    nonbreaking_force_tab: false,
    paste_merge_formats: true,
    paste_postprocess: function(plugin, args) {
      let nodeList = args.node.childNodes
      // console.log(nodeList)
      console.log('粘贴中删掉的空节点：');
      for (var i=0;i<nodeList.length;i++) {
        if (/^\s+$/.test(nodeList[i].innerText)) {
          console.log(nodeList[i])
          args.node.removeChild(nodeList[i])
        }
      }
      // console.log(plugin)
    },
    entity_encoding : "raw",
    // images_upload_handler: function (blobInfo, success, failure) {
    //   var xhr, formData;
  
    //   xhr = new XMLHttpRequest();
    //   xhr.withCredentials = false;
    //   xhr.open('POST', 'http://127.0.0.1:2020/upload');
  
    //   xhr.onload = function() {
    //     var json;
  
    //     if (xhr.status < 200 || xhr.status >= 300) {
    //       failure('HTTP Error: ' + xhr.status);
    //       return;
    //     }
  
    //     json = JSON.parse(xhr.responseText);
  
    //     if (!json || typeof json.location != 'string') {
    //       failure('Invalid JSON: ' + xhr.responseText);
    //       return;
    //     }
  
    //     success(json.location);
    //   };
  
    //   formData = new FormData();
    //   formData.append('file', blobInfo.blob(), fileName(blobInfo));
      
    //   xhr.send(formData);

    //   function fileName(name) {
    //     console.log(name)
    //   }
    // }
}



export default DefaultConfig